<template>
	<!-- <div>{{ msg }}</div> -->
	<div>
		<!-- Main Wrapper -->
		<div class="main-wrapper">
			<!-- Header -->
			<div class="header">
				<!-- Logo -->
				<div class="header-left">
					<a href="index.html" class="logo">
						<img src="../assets/img/logo.png" alt="Logo" />
					</a>
					<a href="index.html" class="logo logo-small">
						<img src="../assets/img/logo-small.png" alt="Logo" width="30" height="30" />
					</a>
				</div>
				<!-- /Logo -->
				<a href="javascript:void(0);" id="toggle_btn">
					<i class="fas fa-bars"></i>
				</a>
				<div class="top-nav-search">
					<form>
						<input type="text" class="form-control" placeholder="Search here" />
						<button class="btn" type="submit">
							<i class="fa fa-search"></i>
						</button>
					</form>
				</div>
				<!-- Mobile Menu Toggle -->
				<a class="mobile_btn" id="mobile_btn"> <i class="fas fa-bars"></i> </a>
				<!-- /Mobile Menu Toggle -->
				<!-- Header Right Menu -->
				<ul class="nav user-menu">
					<!-- Flag -->
					<li class="nav-item dropdown has-arrow flag-nav mr-2">
						<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">
							<img src="../assets/img/flags/us-1.png" alt="" width="32" height="32"
								class="rounded-circle" />
						</a>
						<div class="dropdown-menu dropdown-menu-right">
							<a href="javascript:void(0);" class="dropdown-item">
								<img src="../assets/img/flags/us.png" alt="" height="16" /> English
							</a>
							<a href="javascript:void(0);" class="dropdown-item">
								<img src="../assets/img/flags/fr.png" alt="" height="16" /> French
							</a>
							<a href="javascript:void(0);" class="dropdown-item">
								<img src="../assets/img/flags/es.png" alt="" height="16" /> Spanish
							</a>
							<a href="javascript:void(0);" class="dropdown-item">
								<img src="../assets/img/flags/de.png" alt="" height="16" /> German
							</a>
						</div>
					</li>
					<!-- /Flag -->
					<!-- Notifications -->
					<li class="nav-item dropdown">
						<a href="#" class="nav-link notifications-item">
							<i class="feather-bell"></i>
							<span class="badge badge-pill">3</span>
						</a>
					</li>
					<!-- /Notifications -->
					<!-- Chat -->
					<li class="nav-item dropdown">
						<a href="chat.html" class="dropdown-toggle nav-link chat-header">
							<i class="feather-message-square"></i>
							<span class="badge badge-pill header-chat">6</span>
						</a>
					</li>
					<!-- /Chat -->
					<li class="nav-item dropdown has-arrow main-drop ml-md-3">
						<a href="#" class="dropdown-toggle nav-link" data-toggle="dropdown">
							<span class="user-img"><img src="../assets/img/avatar.jpg" alt="" />
								<span class="status online"></span></span>
						</a>
						<div class="dropdown-menu">
							<a class="dropdown-item" href="profile.html"><i class="feather-user"></i> My Profile</a>
							<a class="dropdown-item" href="login.html"><i class="feather-power"></i> Logout</a>
						</div>
					</li>
				</ul>
				<!-- /Header Right Menu -->
			</div>
			<!-- /Header -->

			<!-- Sidebar -->
			<div class="sidebar" id="sidebar">
				<div class="sidebar-inner slimscroll">
					<div id="sidebar-menu" class="sidebar-menu">
						<ul>
							<li class="menu-title"><span>Main</span></li>
							<!-- <li class="active">
                <a @click="jixiao"
                  ><i class="feather-list"></i><span class="shape1"></span
                  ><span class="shape2"></span> <span>医生绩效配置</span></a
                >
              </li> -->
							<!-- <li class="submenu">
                <a href="#"
                  ><i class="feather-grid"></i> <span>设备管理</span>
                  <span class="menu-arrow"></span
                ></a>
                <ul>
                  <li style="color: #ffff" @click="fanhui"><a>新增分类</a></li>
                  <li style="color: #ffff" @click="shebei"><a>新增设备</a></li>
                </ul>
              </li> -->
							<!-- <li style="color: #ffff" @click="yygzt">
                <a><i class="feather-user"></i> <span>预约工作台</span></a>
              </li> -->
							<li style="color: #ffff" @click="rzsh">
								<a><i class="feather-home"></i><span>认证审核</span></a>
							</li>
							<!-- <li style="color: #ffff" @click="myyy">
                <a><i class="feather-user"></i> <span>我的预约</span></a>
              </li> -->
							<!-- <li style="color: #ffff" @click="myrenzheng">
								<a><i class="feather-calendar"></i> <span>我的认证</span></a>
							</li> -->
							<!-- <li class="submenu">
                <a href="#"
                  ><i class="feather-grid"></i> <span>设备</span>
                  <span class="menu-arrow"></span
                ></a>
                <ul>
                  <li style="color: #ffff" @click="czrz"><a>操作日志</a></li>
                  <li style="color: #ffff" @click="zhgl"><a>账号管理</a></li>
                  <li style="color: #ffff" @click="password">
                    <a>修改密码</a>
                  </li>
                </ul>
              </li> -->
						</ul>
					</div>
				</div>
			</div>
			<!-- /Sidebar -->

			<!-- Page Wrapper -->
			<div class="page-wrapper">
				<div class="content container-fluid">
					<div class="row">
						<div class="col-sm-12">
							<div class="card">
								<div class="card-body">
									<div class="title">
										<div class="line"></div>
										<div class="text">认证提交信息-审核</div>
										<button style="
                        width: 20%;
                        height: 40px;
                        border-radius: 5px;
                        background: rgb(190, 47, 46);
                        color: #ffff;
                        border: 0;
                        font-size: 15px;
                        font-weight: 600;
                        display: flex;
                        flex-direction: row;
                        justify-content: center;
                        padding-top: 1%;
                        margin-left:8%;
                      " @click="ok(2)">
											<img style="width: 20%" src="../assets/img/baocun.png" alt="" />
											<p style="margin-left: 5%">拒绝</p>
										</button>
										<button style="
                        width: 20%;
                        height: 40px;
                        border-radius: 5px;
                        background: rgb(190, 47, 46);
                        color: #ffff;
                        border: 0;
                        font-size: 15px;
                        font-weight: 600;
                        display: flex;
                        flex-direction: row;
                        justify-content: center;
                        padding-top:1%;
                        margin-left:1%;
                      " @click="ok(1)">
											<img style="width: 20%" src="../assets/img/baocun.png" alt="" />
											<p style="margin-left: 5%">审核通过</p>
										</button>
										<button style="
                        width: 20%;
                        height: 40px;
                        margin-left: 1%;
                        border-radius: 5px;
                        background: #ffff;
                        color: rgb(190, 47, 46);
                        border: 1px solid rgb(190, 47, 46);
                        font-size: 15px;
                        font-weight: 600;
                        display: flex;
                        flex-direction: row;
                        justify-content: center;
                      " @click="fanhui1">
											<img style="width: 30%; " src="../assets/img/fanhui.png" alt="" />
											<p style="margin-top: 8%">返回</p>
										</button>
									</div>
									<div>
										<div style="display: flex;flex-direction: row;margin-top:4%;">
											<div style="width:85%">
												<el-steps :active="2">
													<el-step title="注册" :description="input5"></el-step>
													<el-step title="认证提交" :description="input5"></el-step>
													<!-- <el-step title="审核中" :description="input5"></el-step> -->
													<el-step title="认证结果" :description="zhuangtaiarr[zhuangtai]">1</el-step>
												</el-steps>
											</div>
											<div style="height: 35px;
    text-align: center;
	line-height:35px;
    font-size: 16px;
    padding: 1px 5px;
    border-radius: 9px;
    border: 1px solid rgb(190,47,46);
    color: rgb(190,47,46);  width: 140px;   font-weight: 600;">编号：{{A01}}</div>
										</div>

										<div class="shenhe">
											<div class="sh1">
												<div class="aa">
													<div class="aa1">姓名</div>
													<el-input style="    margin-top: 8%;" placeholder="请输入"
														v-model="input5">
													</el-input>
												</div>
												<div class="aa" style="margin-left: 2%;">
													<div class="aa1">手机号</div>
													<el-input style="    margin-top: 8%;" placeholder="请输入"
														v-model="input11">
													</el-input>
												</div>
												<div class="aa" style="margin-left: 2%;">
													<div class="aa1">工号</div>
													<el-input style="    margin-top: 8%;" placeholder="请输入"
														v-model="input1_1">
													</el-input>
												</div>
												<div class="aa" style="margin-left: 2%;">
													<div class="aa1">性别</div>
													<el-input style="    margin-top: 8%;" placeholder="男"
														v-if="this.sex==1">
													</el-input>
													<el-input style="    margin-top: 8%;" placeholder="女"
														v-if="this.sex==2">
													</el-input>
												</div>
												<div class="aa" style="margin-left: 2%;">
													<div class="aa1">年龄</div>
													<el-input style="    margin-top: 8%;" placeholder="请输入"
														v-model="input1_123">
													</el-input>
												</div>
												<!-- <div class="aa">
                          <div class="aa1">医疗机构</div>
                          <el-input
                          style="    margin-top: 8%;"
                            placeholder="A医疗机构"
                            v-model="input"
                            :disabled="true">
                          </el-input>
                        </div> -->
												<!-- <div class="aa" style="margin-left: 3%;margin-top: 1.5%;">
                          <div class="aa1">国家老年疾病临床医学研究中心组织架构时间</div>
                          <el-date-picker
                          style="    margin-top: 8%;"
                            v-model="value1"
                            type="datetime"
                            placeholder="选择日期时间">
                          </el-date-picker>
                        </div> -->
												<!-- <div class="aa" style="margin-left: 3%;margin-top: 1.5%;">
                          <div class="aa1">是否规范了国家老年疾病临床医学研究中心主要环节</div>
                           <el-select v-model="value" placeholder="请选择"
                            style="    margin-top: 8%;">
                            <el-option
                              v-for="item in options"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                            </el-option>
                          </el-select>
                        </div> -->
												<!-- <div class="aa" style="margin-left: 3%;margin-top: 1.5%;">
                          <div class="aa1">制定国家老年疾病临床医学研究中心管理制度</div>
                           <el-select v-model="value2" placeholder="请选择" style="    margin-top: 8%;">
                            <el-option
                              v-for="item in option"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                            </el-option>
                          </el-select>
                        </div> -->
											</div>
											<div class="sh2">
												<div class="aa">
													<div class="aa1">医疗机构</div>
													<el-input style="    margin-top: 8%;" placeholder="A医疗机构"
														v-model="input">
													</el-input>
												</div>
												<div class="aa" style="margin-left: 2%">
													<div class="aa1">是否规范了国家老年疾病临床医学研究中心主要环节</div>
													<el-select v-model="value" placeholder="请选择"
														style="    margin-top: 4%;    width: 100%;">
														<el-option v-for="item in options" :key="item.value"
															:label="item.label" :value="item.value">
														</el-option>
													</el-select>
												</div>
												<div class="aa" style="margin-left: 2%;">
													<div class="aa1">制定国家老年疾病临床医学研究中心管理制度</div>
													<el-select v-model="value2" placeholder="请选择"
														style="    margin-top: 4%;    width: 100%;">
														<el-option v-for="item in option" :key="item.value"
															:label="item.label" :value="item.value">
														</el-option>
													</el-select>
												</div>
												<div class="aa" style="margin-left: 2%;">
													<div class="aa1">建立区域协调体系</div>
													<el-select v-model="value3" placeholder="请选择" style="    margin-top: 7%;">
														<el-option v-for="item in option1" :key="item.value"
															:label="item.label" :value="item.value">
														</el-option>
													</el-select>
												</div>
											</div>
											<div class="sh4">
												<div class="aa">
													<div class="aa1">录入、审核、归档填报数据时间</div>
													<el-input v-model="input1" :disabled="true" style="    margin-top: 7%;">
													</el-input>
												</div>
												<div class="aa" style="margin-left:2%;">
													<div class="aa1">修改时间</div>
													<el-input placeholder="2019-09-09" v-model="input16"
														:disabled="true" style="margin-top: 7%;
    height: 40px;">
													</el-input>
												</div>
												<div class="aa" style="margin-left:2%;">
													<div class="aa1">填报人员</div>
													<el-input v-model="input2" style="margin-top: 7%;
    height: 40px;">
													</el-input>
												</div>
												<div class="aa" style="margin-left:2%;">
													<div class="aa1">审核状态</div>
													<input type="text" value="审核中" v-if="this.zhuangtai==0" style="margin-top: 7%;
    height: 40px;
    border: 1px solid #8888;
    border-radius: 2%;">
													<input type="text" value="已通过" v-if="this.zhuangtai==1" style="margin-top: 7%;
    height: 40px;
    border: 1px solid #8888;
    border-radius: 2%;">
													<input type="text" value="已拒绝" v-if="this.zhuangtai==2" style="margin-top: 7%;
    height: 40px;
    border: 1px solid #8888;
    border-radius: 2%;">
												</div>
											</div>
											<div class="sh3">
												<div>医院相关图：</div>
												<img :src="img">
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- /Page Wrapper -->
		</div>
		<!-- /Main Wrapper -->
	</div>
</template>

<script src="../assets/js/jquery-3.6.0.min.js"></script>
<script src="../assets/js/bootstrap.bundle.min.js"></script>
<script src="../assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="../assets/js/script.js"></script>
<script>
	export default {
		data() {
			return {
				img: '',
				tupian: '',
				sex: 1,
				A01: 0,
zhuangtaiarr:['审核中','已通过','已拒绝'],
				zhuangtai: 0,
				ids: 0,
				input: "",
				input1: "",
				input11: "",
				input2: "",
				input5: "",
				input1_1: "",
				input1_12: "",
				input1_123: "",
				input16: "",
				value1: '',
				value2: '',
				value3: '',
				value: "",
				imageUrl: '',
				imageUrl1: '',
				imageUrl2: "",
				num: 1,
				options: [{
					value: '是',
					label: '是'
				}, {
					value: '否',
					label: '否'
				}, ],
				option: [{
					value: '是',
					label: '是'
				}, {
					value: '否',
					label: '否'
				}, ],
				option1: [{
					value: '是',
					label: '是'
				}, {
					value: '否',
					label: '否'
				}, ],
			};
		},
		mounted() {
			$('#sidebar-menu a').on('click', function(e) {
				if ($(this).parent().hasClass('submenu')) {
					e.preventDefault();
				}
				if (!$(this).hasClass('subdrop')) {
					$('ul', $(this).parents('ul:first')).slideUp(350);
					$('a', $(this).parents('ul:first')).removeClass('subdrop');
					$(this).next('ul').slideDown(350);
					$(this).parent().find('a.active').next().slideDown(350);
					$(this).addClass('subdrop');
				} else if ($(this).hasClass('subdrop')) {
					$(this).removeClass('subdrop');
					$(this).next('ul').slideUp(350);
					$(this).parent().find('a').next().slideUp(350);
				}
			});
			$('#sidebar-menu ul li.submenu a.active').parents('li:last').children('a:first').addClass('active').trigger(
				'click');
		},
		created() {
			this.ids = this.$route.query.id
			console.log("显示", this.ids)
			this.axios.get('/audit/getAuditById?id=' + this.ids).then(res => {
				this.zhuangtai = res.status;
				this.A01 = res.applyNumber;
				this.input5 = res.name;
				this.input11 = res.phone;
				this.input1_1 = res.workId;
				this.input1_123 = res.age;
				// this.sex = res.sex;
				this.input = res.medicalOrganization;
				this.value = res.specificationCenter;
				this.value2 = res.manageSystem;
				this.value3 = res.coordinate;
				this.input1 =new Date(res.createTime).toLocaleDateString();
				this.input16 = res.updateTime;
				this.input2 = res.writtenBy;
				this.img = res.file;
				console.log("数据", res)
			})
		},
		methods: {
			// 无用
			jixiao() {},
			// 无用结束
			add() {
				// this.axios.post('/category', {
				//   name: this.input1,//分类名称
				//   remark: this.input2,//描述
				//   creator: this.input//创建人
				// }).then(res => {
				//   console.log('新增数据', res)
				//   if (res.code == 200) {
				//     this.$message({
				//       message: '新增成功',
				//       type: 'success'
				//     });
				//     this.$router.push("/sbfenlei")
				//   }
				// })
			},
			// 审核结果
			ok(stat) {
				if(this.input1_1 == null){
					    this.$message({
				      message: '请输入工号',
				      type: 'error'
				    });
					return
				}
				
				
				if(stat == 1){
					this.axios.post("/audit/alterStatus",{
						// params:{
							id:this.ids,
							applyNumber:this.A01,
							name:this.input5,
							phone:this.input11,
							workId:this.input1_1,
							password:"12345111111",
							sex:this.sex,
							age:this.input1_123,
							medicalOrganization:this.input,
							specificationCenter:this.value,
							manageSystem:this.value2,
							coordinate:this.value3,
							createTime:Date.parse(new Date()),
							updateTime:this.input16,
							writtenBy:this.input2,
							status:stat,
							file:this.img,
							reject:'无',
							hfcoTime:null,
							ifCoordinate:null,
							ifMs:null,
							ifSc:null
						// },
					}).then(res=>{
							if(stat == 1){
								this.axios.post('/audit/createPwd?id='+id).then(res=>{
									console.log('成功',res)
									
								})
								
							}
							
					})
					this.$message({
				      message: '审核成功',
				      type: 'success'
					})
					this.$router.push("/rzsh")
					return
					
				};
				
				if(stat == 2){
					this.$prompt('请输原因', '提示', {
					          confirmButtonText: '确定',
					          cancelButtonText: '取消',
					        }).then(({ value }) => {
					         this.axios.post("/audit/alterStatus",{
								 	id:this.ids,
							applyNumber:this.A01,
							name:this.input5,
							phone:this.input11,
							workId:this.input1_1,
							password:"12345111111",
							sex:this.sex,
							age:this.input1_123,
							medicalOrganization:this.input,
							specificationCenter:this.value,
							manageSystem:this.value2,
							coordinate:this.value3,
							createTime:Date.parse(new Date()),
							updateTime:this.input16,
							writtenBy:this.input2,
							status:stat,
							file:this.img,
							reject:value,
							hfcoTime:null,
							ifCoordinate:null,
							ifMs:null,
							ifSc:null
							 }).then(res=>{
					         })
					        }).catch(() => {
					              
					        });
				}
			
			},
			handleChange(value) {
				console.log(value);
			},
			password() {
				this.$router.push("/password")
			},
			zhgl() {
				this.$router.push("/zhgl")
			},
			czrz() {
				this.$router.push("/czrz")
			},
			myrenzheng() {
				this.$router.push("/myrenzheng")
			},
			myyy() {
				this.$router.push("/myyy")
			},
			rzsh() {
				this.$router.push("/rzsh")
			},
			yygzt() {
				this.$router.push("/yuyue")
			},
			shebei() {
				this.$router.push("/sbguanli")
			},
			fanhui() {
				this.$router.push("/sbfenlei");
			},
			fanhui1() {
				this.$router.push("/rzsh")
			},
			handleAvatarSuccess() {},
			beforeAvatarUpload(file) {
				const isJPG = file.type === 'image/jpeg';
				const isLt2M = file.size / 1024 / 1024 < 2;

				return file;
			},
			xiu(response, file, fileList) {
				console.log("图片", response)
				this.tupian = "http://119.45.22.35:9090/" + response.data.filename
			}
		},
		// async created() {
		//   this.msg = await this.axios.post("/xs_demo", { name: "我是姓名" });
		// },
	};
</script>

<style src="../assets/css/bootstrap.min.css"></style>
<style src="../assets/plugins/fontawesome/css/fontawesome.min.css"></style>
<style src="../assets/plugins/fontawesome/css/all.min.css"></style>
<style src="../assets/css/feather.css"></style>
<style src="../assets/css/style.css"></style>
<style lang="less" scoped>
/deep/.el-step__head.is-finish{
	color: #AE1C27;
	border: #AE1C27;
}
/deep/.el-step__title.is-finish{
	color: #AE1C27;
}
/deep/.el-step__description.is-finish{
	color: #AE1C27;
}
	.card {
		width: 90%;
		margin: 0 auto;
	}

	.title {
		display: flex;
		flex-direction: row;

		.line {
			width: 5px;
			height: 25px;
			background: rgb(190, 47, 46);
		}

		.text {
			width: 100vh;
			font-size: 18px;
			font-weight: 600;
			margin-left: 1%;
		}
	}

	.shenhe {
		width: 100%;
		padding-bottom: 30px;
		background: rgb(237, 238, 250);

		.sh1 {
			display: flex;
			flex-direction: row;
			margin-top: 2%;

			.aa {
				margin-top: 2%;

				.aa1 {
					margin-top: 1%;
				}
			}
		}

		.sh2 {
			display: flex;
			flex-direction: row;
			margin-top: 2%;

			.aa {
				margin-top: 2%;

				.aa1 {
					height: 10vh;
					margin-top: 1%;
				}
			}
		}

		.sh4 {
			display: flex;
			flex-direction: row;
			margin-top: 2%;

			.aa {
				margin-top: 2%;

				.aa1 {
					height: 5vh;
					margin-top: 1%;
				}
			}
		}

		.sh3 {
			display: flex;
			flex-direction: row;
			margin-top: 2%;

			.avatar-uploader {
				border: 1px solid rgb(204, 204, 204);
			}

			.avatar-uploader .el-upload {
				border: 1px solid #d9d9d9;
				border-radius: 6px;
				cursor: pointer;
				position: relative;
				overflow: hidden;
			}

			.avatar-uploader .el-upload:hover {
				border-color: #AE1C27;
			}

			.avatar-uploader-icon {
				font-size: 28px;
				color: rgb(249, 249, 249);
				width: 140px;
				height: 140px;
				line-height: 140px;
				text-align: center;
			}

			.avatar {
				width: 140px;
				height: 140px;
				display: block;
			}
		}
	}
</style>
